package xyz.wadewhy.basicstest.designPatterns.AbstractFactoryModel;

/**
 * @ClassName FurnitureFactory
 * @Description 业务用途
 * @Author zhongzihao
 * @Date 2021/12/19 7:34 下午
 * @Version 1.0
 **/
abstract class FurnitureFactory {
    /**
     * 获得ChairInterface
     *
     * @return ChairInterface
     */
    abstract ChairInterface getChairInterface();

    /**
     * 获得TableInterface
     *
     * @return TableInterface
     */
    abstract TableInterface getTableInterface();
}

class ChineseFurniture extends FurnitureFactory {

    @Override
    ChairInterface getChairInterface() {
        return new ChineseChair();
    }

    @Override
    TableInterface getTableInterface() {
        return new ChineseTable();
    }
}

class EnglishFurniture extends FurnitureFactory {

    @Override
    ChairInterface getChairInterface() {
        return new EnglishChair();
    }

    @Override
    TableInterface getTableInterface() {
        return new EnglishTable();
    }
}
